***Replication file 
***Looking for twins: how to build better counterfactuals with matching
***By Stefano Costalli, Università degli Studi di Firenze, and Fedra Negri, Università degli Studi di Milano
***Published on the Italian Political Science Review (2021)

ssc install cem


***Table 2***

*Model 1*
xtpcse log_victims past_vict past_pkpres log_pop nat_polar contig_hr contig_srb internal_bord share_cultland

*Model 2*
xtpcse log_victims past_vict past_pk1dicot log_pop nat_polar contig_hr contig_srb internal_bord share_cultland


***Table 3***

*Calculating Multivariate L1 distance*
imb nat_polar past_vict log_pop contig_hr contig_srb internal_bord share_cultland, treatment(past_pkpres)

*Matching the cases*

*Coarsening 1*
cem nat_polar past_vict log_pop contig_hr contig_srb, treatment(past_pkpres)

*Coarsening 2*
cem nat_polar past_vict log_pop contig_hr contig_srb internal_bord share_cultland, treatment(past_pkpres)


***Table 4***

*Calculating Multivariate L1 distance*
imb nat_polar past_vict log_pop contig_hr contig_srb internal_bord share_cultland, treatment(past_pk1dicot)

*Matching the cases*

*Coarsening 1*
cem nat_polar past_vict log_pop contig_hr contig_srb, treatment(past_pk1dicot)

*Coarsening 2*
cem nat_polar past_vict log_pop contig_hr contig_srb internal_bord share_cultland, treatment(past_pk1dicot)


***Table 5 (to be calculated after the corresponding coarsening in Table 3)***

*Coarsening 1*
reg log_victims nat_polar past_pkpres log_pop [iweight=cem_weights]

*Coarsening 2*
reg log_victims nat_polar past_pkpres log_pop [iweight=cem_weights]


***Table 6 (to be calculated after the corresponding coarsening in Table 4)***

*Coarsening 1*
reg log_victims nat_polar past_pk1dicot log_pop [iweight=cem_weights]

*Coarsening 2*
reg log_victims nat_polar past_pk1dicot log_pop [iweight=cem_weights]




